<template>
    <el-text type="primary" size="large" tag="b">5,添加在父容器上的语法 display : flex;align-items : 每一行中的子元素上下对齐方式</el-text>
    <div class="content_box">
        <div class="child_content_box">
            <el-text>:flex_start;y轴顶部对齐</el-text>
            <div class="align_items_start">
                <div class="child_before_box">1</div>
                <div class="child_before_box">2</div>
                <div class="child_before_box">3</div>
                <div class="child_before_box">4</div>
            </div>
        </div>
        <div class="child_content_box">
            <el-text>:center;y轴中间对齐</el-text>
            <div class="align_items_center">
                <div class="child_before_box" >1</div>
                <div class="child_before_box">2</div>
                <div class="child_before_box">3</div>
                <div class="child_before_box">4</div>
            </div>
        </div>
        <div class="child_content_box">
            <el-text>:flex-end;y轴以底部对齐</el-text>
            <div class="align_items_end">
                <div class="child_before_box">1</div>
                <div class="child_before_box">2</div>
                <div class="child_before_box">3</div>
                <div class="child_before_box">4</div>
            </div>
        </div>
        <div class="child_content_box">
            <el-text>:baseline;盒子高度不一样的情况</el-text>
            <div class="align_items_baseline">
                <div class="child_before_box" >1</div>
                <div class="child_before_box">2</div>
                <div class="child_before_box" style="height: 120px;">3</div>
                <div class="child_before_box">4</div>
            </div>
        </div>
    </div>
</template>
<script setup >

</script>
<style scoped lang="scss">
.content_box {
    display: flex;
    flex-wrap: wrap;
}

.child_content_box {
    margin: 5px;
}

.align_items_start {
    width: 200px;
    height: 200px;
    border: 2px solid #E4E7ED;
    display: flex;
    align-items: flex-start;
}

.align_items_center {
    width: 200px;
    height: 200px;
    border: 2px solid #E4E7ED;
    display: flex;
    align-items: center;
}

.align_items_end {
    width: 200px;
    height: 200px;
    border: 2px solid #E4E7ED;
    display: flex;
    align-items: end;
}
.align_items_baseline{
    width: 200px;
    height: 200px;
    border: 2px solid #E4E7ED;
    display: flex;
    align-items: baseline;
}

.child_before_box {
    width: 40px;
    height: 40px;
    margin: 2px;
    background-color: red;
}

.child_before_box:nth-child(2) {
    background-color: #F56C6C;
}

.child_before_box:nth-child(3) {
    background-color: yellow;
}

.child_before_box:nth-child(4) {
    background-color: green;
}
</style>